package com.spa.infrastructure.util;

import cn.dev33.satoken.stp.StpUtil;
import com.spa.application.dto.login.LoginUser;

public class SessionUtil {

    public static LoginUser getUser() {
        Object obj = StpUtil.getSession().get(StpUtil.getTokenValue());
        return (LoginUser) obj;
    }

    public static void setUser(LoginUser user) {
        StpUtil.getSession().set(StpUtil.getTokenValue(),user);
    }

}
